
package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
)

type SystemCrudRequest struct {

	Pid string `json:"pid" form:"pid"`

	Name string `json:"name" form:"name"`

	MenuId string `json:"menu_id" form:"menu_id"`

	ModelName string `json:"model_name" form:"model_name"`

	TableName string `json:"table_name" form:"table_name"`

	Field string `json:"field" form:"field"`

	MenuIds string `json:"menu_ids" form:"menu_ids"`

	RouteIds string `json:"route_ids" form:"route_ids"`

	MakePath string `json:"make_path" form:"make_path"`

	TableCollation string `json:"table_collation" form:"table_collation"`

	TableComment string `json:"table_comment" form:"table_comment"`

	AddTime string `json:"add_time" form:"add_time"`

}

func (r *SystemCrudRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *SystemCrudRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{

		"pid": "required",

		"name": "required",

		"menu_id": "required",

		"model_name": "required",

		"table_name": "required",

		"field": "required",

		"menu_ids": "required",

		"route_ids": "required",

		"make_path": "required",

		"table_collation": "required",

		"table_comment": "required",

		"add_time": "required",

	}
}

func (r *SystemCrudRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *SystemCrudRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *SystemCrudRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
